﻿using System;

namespace 工厂方法模式
{
    class Program
    {
        static void Main(string[] args)
        {

            #region 简单工厂模式
            PhoneFactory factory = new PhoneFactory();
            Phone hPhone = factory.MarkPhone("华为");
            Phone mPhone = factory.MarkPhone("小米");
            #endregion

            #region 工厂方法模式
            AbstractFactory miFactory = new MiFactory();
            AbstractFactory huaweiFactory = new HuaWeiFactory();
            miFactory.MakePhone();
            huaweiFactory.MakePhone();
            #endregion
        }
    }
}
